<template>
  <view class="app-user-msg">
    <div class="block">
      <el-avatar :size="50" :src="appUrl" />
    </div>
    <div class="message">
      <div class="content">
      {{msg}}  
      </div>
      <div class="san"></div>
    </div>
  </view>
</template>

<script setup>
const appUrl = ref("https://img2.baidu.com/it/u=764493433,253133472&fm=253&fmt=auto&app=138&f=JPEG?w=342&h=342");
const props=defineProps({
  msg: {
    type: String,
    default: ""
  }
})
</script>

<style lang="scss" scoped>
.app-user-msg {
  display: flex;

  .message {
    background-color: #efefef;
    position: relative;
    left: 10px;
    min-height: 40px;
    max-width: 300px;
    border-radius: 5px;
    font-size: 20px;
    line-height: 42px;
    padding: 5px;
    /* 如果需要响应式设计 */
    word-wrap: break-word;
    /* 允许长单词或URL地址自动换行 */
    white-space: normal;

    .san {
      position: absolute;
      top: 16px;
      left: -20px;
      display: inline-block;
      border: 10px solid #efefef;
      border-top-color: transparent;
      border-left-color: transparent;
      border-bottom-color: transparent;
    }
  }
}
</style>